package com.park.web.controller.admin;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.park.client.model.user.VisitInfoModel;
import com.park.client.service.user.VisitInfoService;
import com.park.common.util.Result;
import com.park.web.contant.Global;
import com.park.web.controller.BaseController;

@Controller
@RequestMapping("/admin/chart")
public class AdminChartController extends BaseController{

	@Autowired
	private VisitInfoService visitInfoService;
	
	@RequestMapping("areaChart")
	public String areaChart(HttpServletRequest request){
		 return Global.ADMIN_PATH+"chart/areaChart";
	}
	
	@RequestMapping("areaList")
	@ResponseBody
	public Result<List<VisitInfoModel>> areaList(HttpServletRequest request){
		Result<List<VisitInfoModel>> result = new Result<>();
		List<VisitInfoModel> list = visitInfoService.selectByArea();
		result.setObj(list);
		return result;
	}
	
}
